package com.example.design.patterns.geekbang.行为型.观察者模式.EventBus;

import com.example.design.patterns.geekbang.行为型.观察者模式.example.refactor.NotificationService;
import com.google.common.eventbus.Subscribe;

public class RegNotificationObserver {
    private NotificationService notificationService;

    /**
     * @Subscribe 注解来标明类中哪个函数可以接收被观察者发送的消息。
     * @param userId
     */
    @Subscribe
    public void handleRegSuccess(Long userId) {
        notificationService.sendInboxMessage(userId, "...");
    }
}
